import React from 'react';
import "./App.css";
import {
    // BrowserRouter as Router,
    // HashRouter,
    Routes,
    Route,
    // NavLink,
    // Link,
    Navigate,
    // Outlet,
    // useParams,
    useRoutes,
    // useNavigate,
    // useLocation,
    // useSearchParams
} from "react-router-dom";
import NavHeader from "./components/NavHeader";
import My from "./components/My";
import AuthComponent from "./components/AuthComponent";
import Home from "./components/Home";
import NewsList from "./components/NewsList";
import GoodsList from "./components/GoodsList";
import Two from "./components/Two";
import router from "./router";
function App(props) {
    // const routers = useRoutes([
    //     {
    //         path: "/",
    //         element: <Home/>
    //     }, {
    //         path: "/newsList",
    //         element: <AuthComponent><NewsList/></AuthComponent>
    //     },
    //     {
    //         path: "/goodsList",
    //         element: <AuthComponent><GoodsList/></AuthComponent>
    //     },
    //     {
    //         path: "/my",
    //         element: <AuthComponent><My/></AuthComponent>,
    //         children: [
    //             {
    //                 index: true,
    //                 element: <Navigate to={"/my/one"}/>
    //             },{
    //                 path:"/my/one",
    //                 element:<div>one页面</div>
    //             },{
    //                 path:"/my/two/:id/:type.html",
    //                 element:<Two/>
    //             }
    //         ]
    //     },{
    //         path:"/home",
    //         element:<Navigate to={"/"}/>
    //     },{
    //         path:"*",
    //         element:<div>404</div>
    //     }
    // ])
    return (
        <div className={"container"}>
            <NavHeader/>
            {router()}
            {/*<Routes>*/}
            {/*    <Route path={"/"} element={<Home/>}></Route>*/}
            {/*    <Route path={"/newsList"} element={<AuthComponent><NewsList/></AuthComponent>}></Route>*/}
            {/*    <Route path={"/goodsList"} element={<AuthComponent><GoodsList/></AuthComponent>}></Route>*/}
            {/*        <Route path={"/my"} element={<AuthComponent><My/></AuthComponent>}>*/}
            {/*            <Route index element={<Navigate to={"/my/one"}></Navigate>}></Route>*/}
            {/*            <Route path={"/my/one"} element={<div>one页面</div>}></Route>*/}
            {/*            <Route path={"/my/two/:id/:type.html"} element={<Two/>}></Route>*/}
            {/*        </Route>*/}
            {/*    <Route path={"/home"} element={<Navigate to={"/"}/>}></Route>*/}
            {/*    <Route path={"*"} element={<h3>404</h3>}></Route>*/}
            {/*</Routes>*/}

        </div>
    );
}

export default App;